import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:convert';

part 'user_flow_group_response.freezed.dart';
part 'user_flow_group_response.g.dart';

@freezed
class UserFlowGroupResponse with _$UserFlowGroupResponse {
  const factory UserFlowGroupResponse({
    @JsonKey(name: "code") required int code,
    @JsonKey(name: "msg") required String msg,
    @JsonKey(name: "time") required int time,
    @JsonKey(name: "data") required Data data,
  }) = _UserFlowGroupResponse;

  factory UserFlowGroupResponse.fromJson(Map<String, dynamic> json) =>
      _$UserFlowGroupResponseFromJson(json);
}

@freezed
class Data with _$Data {
  const factory Data({
    @JsonKey(name: "total") required int total,
    @JsonKey(name: "per_page") required int perPage,
    @JsonKey(name: "current_page") required int currentPage,
    @JsonKey(name: "last_page") required int lastPage,
    @JsonKey(name: "data") required List<dynamic> data,
  }) = _Data;

  factory Data.fromJson(Map<String, dynamic> json) => _$DataFromJson(json);
}
